package gapp.subsysstate.impl;

import gapp.subsysstate.ISubsysState;
import gapp.subsysstate.State;

// Probably better solved with state, but for simplicity uses an enum
public class SubsysState implements ISubsysState {
	
	State state = State.STATE_1;
	
	// Note private
	private SubsysState(){
	}
	
	//Factory-method. NOTE returning interface
	public static ISubsysState newInstance() {
		return new SubsysState();
	}
	
	// Never called!!
	@Override
	public String doService(String s) {
		return "Hello " + s ;
	}

	@Override
	public State getState() {
		return state;
	}

	@Override
	public void setState(State state) {
		this.state = state;
	}

}
